<?php 
// the facebook client library
include_once '../client/facebook.php';

// some basic library functions
include_once 'lib.php';

// this defines some of your basic setup
include_once 'config.php';

	// your callback url
    $appcallbackurl = 'http://googlewala.com/fb8/';
    // your facebook url of this page
    $inviteurl = 'http://apps.facebook.com/hot_gallery/index.php';
	

$facebook = new Facebook($api_key, $secret);
//default add




$target = $friend_id; 
$titleTemplate = '{actor}  has something to tell you'; 
$titleData = json_encode(array( 
     'game' => 'I have something to tell you', 
     'url'  => 'http://apps.facebook.com/hot_gallery/index.php', 
)); 
$bodyTemplate = " Check it out! {actor} has send a ".$categoryName." sentence in ".$languageName." to <fb:name uid='".$friend_id."' useyou='false'/>.
<a href='http://apps.facebook.com/hot_gallery/confirm.php?cat_id=$_POST[categorys]&language=$_POST[language]&mood=$_POST[mood]&sentence=$_POST[sentence]&friend_id=$uiiid&friendId=$friend_id&text_message=$_POST[textarea]'> Send a reply back</a>"; 
$bodyData = json_encode(array( 
     'url'  => 'http://apps.facebook.com/hot_gallery/index.php', 
)); 
//$bodyGeneral = '<fb:name uid="'.$uiiid.'" useyou="false"/>'; 
$imgSrc = 'http://www.myngle.wiantech.com/upload_file/561_-_5th_img_parot.jpg'; 
$imgLink = 'http://apps.facebook.com/hot_gallery/index.php';

$imgSrc1 = 'http://www.myngle.wiantech.com/upload_file/mood_2.jpg'; 
$imgLink1 = 'http://apps.facebook.com/hot_gallery/index.php';

$imgSrc2 = 'http://www.myngle.wiantech.com/upload_file/mood_3.jpg'; 
$imgLink2 = 'http://apps.facebook.com/hot_gallery/index.php';

$imgSrc3 = 'http://www.myngle.wiantech.com/upload_file/mood_4.jpg'; 
$imgLink3 = 'http://apps.facebook.com/hot_gallery/index.php';

$target_ids=array();
  $target_ids[0]=$friend_id;
 

// Perform the API method call. 
// $facebook->api_client->feed_publishTemplatizedAction($titleTemplate, $titleData, $bodyTemplate, $bodyData, $bodyGeneral, $imgSrc, $imgLink);
if($_REQUEST["public"]=='y')
    {

try {
   
    $facebook->api_client->feed_publishTemplatizedAction($titleTemplate, $titleData, $bodyTemplate, $bodyData, $bodyGeneral, $imgSrc,$imgLink,$imgSrc1,$imgLink1,$imgSrc2,$imgLink2,$imgSrc3,$imgLink3,$target,NULL);
} catch (Exception $e) {
   echo 'Caught exception: ', $e->getMessage(), "\n";
}

    }

?>